package com.aplink.generic.pojo;

import com.aplink.generic.constant.type.ActionType;
import com.aplink.generic.constant.type.ColumnType;
import com.aplink.generic.pojo.controlspec.ValueList;
import com.aplink.generic.pojo.controlspec.menu.PopupMenuSpec;
import com.aplink.generic.util.objectrule.TargetCollection;

public class ColumnSetting {
	public static final String STATIC_RESOURCE = "{StaticResource}";
	public static final String TAG_EMPTY = "";
	private boolean isStaicResource;
	private ActionType mActionType;
	private String mColType;
	private String mDataObj;
	private String mFormat;
	private String mHeaderText;
	private String mLinkMappingName;
	private String mLinkPage;
	private String mMappingName;
	private PopupMenuSpec mPopupMenuSpec;
	private TargetCollection mTargetCollection;
	private ValueList mValueList;

	public ColumnSetting() {
		this.mColType = ColumnSetting.TAG_EMPTY;
		this.mMappingName = ColumnSetting.TAG_EMPTY;
		this.mLinkMappingName = ColumnSetting.TAG_EMPTY;
		this.mLinkPage = ColumnSetting.TAG_EMPTY;
		this.mHeaderText = ColumnSetting.TAG_EMPTY;
		setPopupMenuSpec(new PopupMenuSpec());
	}

	public ActionType getActionType() {
		return mActionType;
	}

	public ColumnType getColType() {
		return ColumnType.get(this.mColType);
	}

	public String getColumnName() {
		return String.format("%s.%s", this.mDataObj, this.mMappingName);
	}

	public String getDataObj() {
		return this.mDataObj;
	}

	public String getFormat() {
		return this.mFormat;
	}

	public String getHeaderText() {
		return this.mHeaderText;
	}

	public String getLinkMappingName() {
		return this.mLinkMappingName;
	}

	public String getLinkPage() {
		return this.mLinkPage;
	}

	public String getMappingName() {
		return this.mMappingName;
	}

	public PopupMenuSpec getPopupMenuSpec() {
		return this.mPopupMenuSpec;
	}

	public TargetCollection getTargetCollection() {
		return mTargetCollection;
	}

	public ValueList getValueList() {
		return this.mValueList;
	}

	public boolean hasValueList() {
		if (this.mValueList == null) {
			return false;
		}
		return !this.mValueList.isEmpty();
	}

	public boolean isStaicResource() {
		return this.isStaicResource;
	}

	public void setActionType(final ActionType actionType) {
		mActionType = actionType;
	}

	public void setColType(final String colType) {
		this.mColType = colType;
	}

	public void setDataObj(final String dataObj) {
		this.mDataObj = dataObj;
	}

	public void setFormat(final String format) {
		this.mFormat = format;
	}

	public void setHeaderText(final String headertext) {
		this.mHeaderText = headertext;
	}

	public void setLinkMappingName(final String linkmappingname) {
		this.mLinkMappingName = linkmappingname;
	}

	public void setLinkPage(final String linkpage) {
		this.mLinkPage = linkpage;
	}

	public void setMappingName(final String mappingname) {
		this.mMappingName = mappingname;
	}

	public void setPopupMenuSpec(final PopupMenuSpec popupMenuSpec) {
		this.mPopupMenuSpec = popupMenuSpec;
	}

	public void setStaicResource(final boolean isStaicResource) {
		this.isStaicResource = isStaicResource;
	}

	public void setTargetCollection(final TargetCollection targetCollection) {
		mTargetCollection = targetCollection;
	}

	public void setValueList(final ValueList valueList) {
		this.mValueList = valueList;
	}
}
